package com.cm.caseManagement.pojo.entity;
import com.cm.caseManagement.annotation.Excel;
import com.cm.caseManagement.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 操作日志对象 cm_sys_operation_log
 *
 * @author ruoyi
 * @date 2025-10-05
 */
public class CmSysOperationLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** 外部唯一id */
    @Excel(name = "外部唯一id")
    private String publicId;

    /** 操作类型：INSERT（新增）、UPDATE（修改）、DELETE（删除）、SELECT（查询）、EXPORT（导出）、LOGIN（登录） */
    @Excel(name = "操作类型：INSERT", readConverterExp = "新=增")
    private String operationType;

    /** 数据库表 */
    @Excel(name = "数据库表")
    private String operationTarget;

    /** 数据库表主键 */
    @Excel(name = "数据库表主键")
    private String targetId;

    /** 操作描述 */
    @Excel(name = "操作描述")
    private String operationDescription;

    /** 修改前数据 */
    @Excel(name = "修改前数据")
    private String oldData;

    /** 修改后数据 */
    @Excel(name = "修改后数据")
    private String newData;

    /** 操作人ID */
    @Excel(name = "操作人ID")
    private Long operatorId;

    /** 操作人姓名 */
    @Excel(name = "操作人姓名")
    private String operatorName;

    /** 操作人IP */
    @Excel(name = "操作人IP")
    private String operatorIp;

    /** 操作设备 */
    @Excel(name = "操作设备")
    private String operatorDevice;

    /** 扩展信息 */
    @Excel(name = "扩展信息")
    private String extendedInfo;

    /** 操作时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date operationTime;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setPublicId(String publicId)
    {
        this.publicId = publicId;
    }

    public String getPublicId()
    {
        return publicId;
    }

    public void setOperationType(String operationType)
    {
        this.operationType = operationType;
    }

    public String getOperationType()
    {
        return operationType;
    }

    public void setOperationTarget(String operationTarget)
    {
        this.operationTarget = operationTarget;
    }

    public String getOperationTarget()
    {
        return operationTarget;
    }

    public void setTargetId(String targetId)
    {
        this.targetId = targetId;
    }

    public String getTargetId()
    {
        return targetId;
    }

    public void setOperationDescription(String operationDescription)
    {
        this.operationDescription = operationDescription;
    }

    public String getOperationDescription()
    {
        return operationDescription;
    }

    public void setOldData(String oldData)
    {
        this.oldData = oldData;
    }

    public String getOldData()
    {
        return oldData;
    }

    public void setNewData(String newData)
    {
        this.newData = newData;
    }

    public String getNewData()
    {
        return newData;
    }

    public void setOperatorId(Long operatorId)
    {
        this.operatorId = operatorId;
    }

    public Long getOperatorId()
    {
        return operatorId;
    }

    public void setOperatorName(String operatorName)
    {
        this.operatorName = operatorName;
    }

    public String getOperatorName()
    {
        return operatorName;
    }

    public void setOperatorIp(String operatorIp)
    {
        this.operatorIp = operatorIp;
    }

    public String getOperatorIp()
    {
        return operatorIp;
    }

    public void setOperatorDevice(String operatorDevice)
    {
        this.operatorDevice = operatorDevice;
    }

    public String getOperatorDevice()
    {
        return operatorDevice;
    }

    public void setExtendedInfo(String extendedInfo)
    {
        this.extendedInfo = extendedInfo;
    }

    public String getExtendedInfo()
    {
        return extendedInfo;
    }

    public void setOperationTime(Date operationTime)
    {
        this.operationTime = operationTime;
    }

    public Date getOperationTime()
    {
        return operationTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("publicId", getPublicId())
            .append("operationType", getOperationType())
            .append("operationTarget", getOperationTarget())
            .append("targetId", getTargetId())
            .append("operationDescription", getOperationDescription())
            .append("oldData", getOldData())
            .append("newData", getNewData())
            .append("operatorId", getOperatorId())
            .append("operatorName", getOperatorName())
            .append("operatorIp", getOperatorIp())
            .append("operatorDevice", getOperatorDevice())
            .append("extendedInfo", getExtendedInfo())
            .append("operationTime", getOperationTime())
            .toString();
    }
}
